/** @format */

import {service} from '../util/request';
import {to} from '../util';

const user = {
  // 获取文章列表
  getArticleList(params: any) {
    return to(
      service({
        url: '/getArticleList',
        method: 'get',
        params,
      }),
    );
  },
  // 获取文章
  getArticle(params: any) {
    return to(
      service({
        url: '/getArticle',
        method: 'get',
        params,
      }),
    );
  },
  // 获取文章分类
  getCategory(params: any) {
    return to(
      service({
        url: '/getCategory',
        method: 'get',
        params,
      }),
    );
  },
  // 获取界面配置信息
  getInterfaceConfig(params: any) {
    return to(
      service({
        url: '/getInterfaceConfig',
        method: 'get',
        params,
      }),
    );
  },
  // 发表评论
  postcomment(params: any) {
    return to(
      service({
        url: '/postcomment',
        method: 'post',
        params,
      }),
    );
  },
};

export {user};
